import 'package:business_boost/pages/boost_main_page.dart';
import 'package:business_boost/routes/boost_routes.dart';
import 'package:business_boost/widget/boost_test_bottom_sheet.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:lib_core/lib_core.dart';
import 'package:lib_core/routes/boost_bottom_sheet.dart';

class BoostPages {
  BoostPages._();

  static final Map<String, FlutterBoostRouteFactory> boostPages = {
    BoostRoutes.boostTestBottomSheet: ((settings, uniqueId) {
      final arg = settings.arguments as Map<String, dynamic>?;
      Color? backgroundColor = arg?['backgroundColor'];
      double? elevation = arg?['elevation'];
      bool persistent = arg?['persistent'] ?? true;
      ShapeBorder? shape = arg?['shape'];
      Clip? clipBehavior = arg?['clipBehavior'];
      Color? barrierColor = arg?['barrierColor'] ?? Colors.black.withOpacity(0.25);
      bool? ignoreSafeArea = arg?['ignoreSafeArea'];
      bool? removeBottom = arg?['removeBottom'];
      bool isScrollControlled = arg?['isScrollControlled'] ?? false;
      bool isDismissible = arg?['isDismissible'] ?? true;
      bool enableDrag = arg?['enableDrag'] ?? true;
      Duration? enterBottomSheetDuration = arg?['enterBottomSheetDuration'];
      Duration? exitBottomSheetDuration = arg?['exitBottomSheetDuration'];
      return BoostModalBottomSheetRoute(
        builder: (_) => BoostTestBottomSheet(),
        isPersistent: persistent,
        isScrollControlled: isScrollControlled,
        backgroundColor: backgroundColor ?? Colors.transparent,
        elevation: elevation,
        shape: shape,
        removeTop: ignoreSafeArea ?? true,
        removeBottom: removeBottom ?? false,
        clipBehavior: clipBehavior,
        isDismissible: isDismissible,
        modalBarrierColor: barrierColor,
        settings: settings,
        enableDrag: enableDrag,
        enterBottomSheetDuration: enterBottomSheetDuration ?? const Duration(milliseconds: 250),
        exitBottomSheetDuration: exitBottomSheetDuration ?? const Duration(milliseconds: 200),
      );
    }),
    BoostRoutes.boostMainPage: ((setting, uniqueId) => CupertinoPageRoute(
        settings: setting,
        builder: (_) {
          final arguments = setting.arguments as Map<String, dynamic>?;
          return BoostMainPage(argument: arguments);
        })),
  };
}
